/**
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2023-12-24 16:29:28
 * @Description  : 初始化redis，链接到redis
 */

const redis = require('redis')
const { redisUrl } = require('@/config/config.default')

const client = redis.createClient({
  url: redisUrl
})
client.connect()
client.on('connect', () => {
  console.log('connnect to redis successfully')
})

client.on('error', function (err) {
  console.log(err)
})

module.exports = client
